
function utf8Length(unicodeString)
{var usl=0;for(var i=0;unicodeString.length>i;++i)
{var codePoint=unicodeString.charCodeAt(i);if(codePoint===10||codePoint===13){usl+=2;}else if(128>codePoint){usl+=1;}else if((codePoint>127)&&(2048>codePoint)){usl+=2;}else{usl+=3;}}
return usl;}